function showStuff(id) {
		document.getElementById(id).style.display = 'inline';
}

function hideStuff(id) {
		document.getElementById(id).style.display = 'none';
}


function locationInit(){
	if(geo_position_js.init()){
		geo_position_js.getCurrentPosition(getAndFillLocations,errorInLocation,{enableHighAccuracy:true});
	}else{
		    hideStuff("detecting-location");
			showStuff("location-not-found");
	}
}

function getAndFillLocations(p){
  document.getElementById("latitude").value = p.coords.latitude;
  document.getElementById("longitude").value = p.coords.longitude;
  document.getElementById("accuracy").value = p.coords.accuracy;
  hideStuff("detecting-location");
  showStuff("location-found");
}

function errorInLocation(p){
    hideStuff("detecting-location");
    showStuff("location-not-found");
}